﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Description;
using Devtm.ServiceModel.Proxy;

namespace Devtm.ServiceModel
{


    public interface IServiceDirectories
    {

        U Get<U>() where U : ServiceEndpoint;

        IServiceResolver EndpointResolver(ProxyConfiguration proxy);

    }



    public class ServiceDirectories<T> : List<T>, IServiceDirectories
        where T : ServiceEndpoint
    {

        public U Get<U>()
            where U : ServiceEndpoint
        {
            return this.FirstOrDefault() as U;
        }

        public virtual IServiceResolver EndpointResolver(ProxyConfiguration proxy)
        {
            return null;
        }

    }


}
